package com.css.dzj.dzjportal.modules.todo.mapper;

import com.css.dzj.dzjportal.modules.todo.entity.PortalTodoEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 待办Mapper
 * @author zhouchanghe
 */
@Repository
public interface PortalTodoMapper extends JpaRepository<PortalTodoEntity, String>, JpaSpecificationExecutor<PortalTodoEntity>,
        QuerydslPredicateExecutor<PortalTodoEntity> {

    @Query(nativeQuery = true,value = "select * from PORTAL_TODO t where t.status =:status and t.del_Flag=:delFlag and ((t.location =:location and t.type_Flag=:typeFlag and t.station =:station) or (t.type_Flag=:typeFlag2 and t.create_Person=:createPerson ))")
    List<PortalTodoEntity> queryTodoByLocation(@Param("status") String status, @Param("delFlag") String delFlag, @Param("location") String location, @Param("typeFlag") String typeFlag, @Param("station") String station, @Param("typeFlag2") String typeFlag2, @Param("createPerson") String createPerson);

}


